<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        var age = 20;
        var name = "xing";
        var flag = true;
        var user = {};
        // typeof 判断数据类型（判断基本数据类型使用）
        console.log(typeof age);
        console.log(typeof name);
        console.log(typeof flag);
        console.log(typeof user);

        console.log(typeof []); //数组打印出来也是object

        console.log(typeof null);
        console.log(typeof undefined);

        // null 一般代表对象为“没有”
        // undefined 一般代表数值为“没有”

    </script>
</body>
</html>